/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clases;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author jackercito
 */
@Entity
@Table(name = "CURSOPRACTICA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cursopractica.findAll", query = "SELECT c FROM Cursopractica c"),
    @NamedQuery(name = "Cursopractica.findAllByIdCursoFK", query = "SELECT c FROM Cursopractica c WHERE c.idcrusofk = :idcursofk"),
    @NamedQuery(name = "Cursopractica.findByIdcursopractica", query = "SELECT c FROM Cursopractica c WHERE c.idcursopractica = :idcursopractica")})
public class Cursopractica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IDCURSOPRACTICA")
    private Integer idcursopractica;
    @JoinColumn(name = "IDPRACTICAFK", referencedColumnName = "IDPRACTICA")
    @ManyToOne
    private Practica idpracticafk;
    @JoinColumn(name = "IDCRUSOFK", referencedColumnName = "IDCURSO")
    @ManyToOne
    private Curso idcrusofk;

    public Cursopractica() {
    }

    public Cursopractica(Integer idcursopractica) {
        this.idcursopractica = idcursopractica;
    }

    public Integer getIdcursopractica() {
        return idcursopractica;
    }

    public void setIdcursopractica(Integer idcursopractica) {
        this.idcursopractica = idcursopractica;
    }

    public Practica getIdpracticafk() {
        return idpracticafk;
    }

    public void setIdpracticafk(Practica idpracticafk) {
        this.idpracticafk = idpracticafk;
    }

    public Curso getIdcrusofk() {
        return idcrusofk;
    }

    public void setIdcrusofk(Curso idcrusofk) {
        this.idcrusofk = idcrusofk;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcursopractica != null ? idcursopractica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cursopractica)) {
            return false;
        }
        Cursopractica other = (Cursopractica) object;
        if ((this.idcursopractica == null && other.idcursopractica != null) || (this.idcursopractica != null && !this.idcursopractica.equals(other.idcursopractica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "clases.Cursopractica[ idcursopractica=" + idcursopractica + " ]";
    }
    
}
